package org.example

/**
 * You can edit, run, and share this code.
 * play.kotlinlang.org
 */
fun main() {
    var res = add(1,2)
    res = max(res,10)
    println(res)
    println(getScore("luo"))
    println(getTypeInfo(89))
}

fun add(a:Int, b:Int) =  a+b

fun max(a:Int,b:Int):Int {
    return if(a>b){
        a
    }else{
        b
    }
}


fun getScore(name :String):Int = when(name){

    "luo"-> 100
    "gao"->99
    else -> 0


}

fun getTypeInfo(type:Number):String = when(type){

    is Int -> "整数"
    is Double -> "双进度"
    else -> "其他"
}

